package com.demo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.demo.common.R;
import com.demo.domain.AddressBook;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

public interface AddressBookService extends IService<AddressBook> {

    /**
     * 新增
     */
    R<AddressBook> addressBookSave(@RequestBody AddressBook addressBook);

    /**
     * 设置默认地址
     */
    R<AddressBook> setDefault(@RequestBody AddressBook addressBook);

    /**
     * 根据id查询地址
     */
    R get(@PathVariable Long id);

    /**
     * 查询默认地址
     */
    R<AddressBook> getDefault();


    /**
     * 查询指定用户的全部地址
     */
    R<List<AddressBook>> list(AddressBook addressBook);
}
